1. Field of the Invention
The present invention relates to a method and device for filtering transmission addresses in Ethernet. The design of the invention is primarily to represent whether a source address exists by only a flag with one bit without storing the entire source address data with 48 bits to achieve a memory capacity much smaller and thus much cheaper than the prior art. The invention is further equipped with a programmable timer to make the method and device for filtering transmission addresses in Ethernet more valuable. The programmable timer solves a problem that the packet data can not be filtered normally since the memory contents are lost.
2. Description of the Prior Art
In modern times, the quantity of nodes can be increased under a construction of a "Local Area Network" (LAN) where Ethernet is connected with every computer device, as shown in FIG. 1. In addition to achieving an effect of expansion by connecting stations with each other through a hub inside an individual Ethernet group, a large Local Area Network is formed by connecting Local Area Networks with each other through a bridge, a switch or a router in different Ethernet groups. An advantage of resource-sharing will be gained by serving the bridge, switch or router as a transmission medium in different Ethernet groups. However, with regard to solving a problem that if data transmissions in different Ethernet groups are not limited, they will lead to networks overload and thus slow down the response speed, a device for filtering transmission addresses is generally provided in every Ethernet group. Such a filtering device can store the source address data into a local network to achieve so called a "learning" effect through repeatedly storing the data of different source addresses. When a packet is subsequently sent, if the source address data of the packet based on this learning process and a comparison source address data previously stored are matched, the source address is in the same local Ethernet group. Thus, the packet data can be prevented from flowing into another Ethernet group and the defect that networks overload because the packet data are transmitted improperly can be also prevented.
Herein networks on the right side are defined as B side networks and networks on the left side are defined as A side networks, as shown in FIGS. 2A, 2B. The filtering ways of transmission addresses in the prior art are proceeded in directions of from B side to A side (B2A) and from A side to B side (A2B) with two groups of identical configurations in the upper portion and the lower portion of the drawings respectively. Take the configuration in the lower portion of the drawing for example, as shown in FIG. 2A. The configuration in the lower portion of the drawing is composed of a source address and destination address extractor (SA/DA extractor) 50, two compressors 51, 52, a destination address (DA) comparing controller 53, a source address (SA) learning controller 54, a memory 55 and a filter 56. First, a source address (SA) and a destination address (DA) are extracted from the input packet (I/P) of B2A sent from a B side network through the SA/DA extractor 50. Then, the SA data with 48 bits are compressed to the address data with 12 bits pointed to a memory address by Hash Algorithm through the compressor 52. If the flag of the corresponding memory address is read to be "0" (indication of no data existence) under the control of the SA learning controller 54, the SA data with 48 bits are written into the memory address directly. At the same time, the corresponding flag is changed to "1" (indication of data existence) to complete the steps for learning.
The DA data extracted through the SA/DA extractor 50 are compressed to the address data with 12 bits through another compressor 51 simultaneously. When the flag of the corresponding memory address read from the DA comparing controller is "0", the DA do not exist. The filter in the lowest side of the drawing will be enabled such that the I/P of B2A may transmit to A side networks (i.e., broadcast). There are address data stored into the corresponding memory address if the flag read from the DA comparing controller is "1". If the address data contained in the memory address and a comparison DA data sent in (proceeded in the DA comparing controller 53) are matched, the DA data is in B side networks. Thus, the filter stops the packet from flowing to left side networks (filter) and reversely, the broadcast work is proceeded toward A side networks.
The I/P of A2B coming from an A side network in the upper portion of the drawing, as shown in FIG. 2B, are proceeded to memorize and compare the address data, and control whether the packet data can be allowed to pass or be blocked through the same process described above and will not be explained repetitiously herein.
The following can sum up the method for filtering transmission addresses in Ethernet described above.
(1) Every memory stores the SA data coming from networks on the same side (in the same Ethernet group). Alternatively, every memory only stores the packet data coming from networks on the same side and compares with the DA data coming from networks on the same side, and thus is irrelevant to networks on the other side. PA0 (2) The DA comparing controller compares the entire 48 bits of the address data. If the address data sent to the DA comparing controller compared with the address data stored previously are matched, the packet should be blocked, and reversely, the packet will be allowed to pass. PA0 (3) When two address data collide, they will be not filtered or a second layer memory will be provided for storing the two groups of address data with the same address. The DA data will be compared twice and the filter will not proceed to filter if the data are matched for a more effective filtering effect. PA0 (1) The target for learning (memorizing) is the SA data coming from networks on the other side. The filtering method of the present invention is totally different from the filtering method that the SA data for learning only come from networks on the same side in the prior art. PA0 (2) The present invention only compares the learning result rather than comparing the entire address data. PA0 (3) Whether the packet data should be blocked or allowed to pass is determined without comparing the address data when two address data collide.
In view of the characteristics for filtering transmission addresses in Ethernet described above, there are some shortcomings which are as follows:
A memory stores the entire address data with 48 bits and has a problem of large memory allocations. Such a problem as taking possession of a memory will become more serious if a second layer memory added provides for storing the address data with the same address as described in the above item (3). Clearly, the efficiency of the memory usage is less than ideal. To achieve the effect of comparing in "real time" and "quickness", the filtering device needs a more complicated and rapid comparing circuit to carry out the mentioned effect when proceeding the data comparing work. Thus, in view of the method for filtering transmission addresses in Ethernet described above, the device for filtering transmission addresses apparently is not ideal and has to be improved.